package com.hy.main.demo.stream;

import org.junit.Test;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author yang DongYong
 * @Date 2022/7/2 - 07 - 02 - 23:12
 * @Description: com.hy.main.demo.stream
 * @version: 1.0
 */
public class Page {

    //测试方法
    @Test
    public void test01(){
        Collection<Student> student = Student.getStudent();
        // skip减一是因为数组下标从0开始
        List<Student> collect = student.stream().skip((0) * 5).limit(5).collect(Collectors.toList());
        System.out.println(collect);
    }
}
